import { getRequest } from '@/api/interceptor'
import { transTopSinger, transTopPlaylist, transToplist } from '@/api/rank/translate'

const REQUEST_URL = {
  topSinger: '/toplist/artist',
  topList: '/toplist',
  topPlaylist: '/playlist/detail'
}

export const getTopSinger = () => {
  return getRequest(REQUEST_URL.topSinger).then(transTopSinger)
}

export const getToplist = () => {
  return getRequest(REQUEST_URL.topList).then(transToplist)
}

export const getTopPlaylist = (id) => {
  return getRequest(REQUEST_URL.topPlaylist, { id }).then(transTopPlaylist)
}
